#include <filesystem>
#include <iostream>
#include <cstring>
#include <errno.h>

#include "init.h"

namespace raster {

namespace fs = std::filesystem;

Path basePath;
Path inPath;
Path outPath;

bool init() {
    basePath = fs::path(PROJECT_ROOT_DIR).lexically_normal();
    inPath   = basePath / "obj";
    outPath  = basePath / "out";

    if (!fs::exists(outPath) || !fs::is_directory(outPath)) {

        if (!fs::create_directories(outPath)) {
            std::cerr << "Failed to create create_directories during initializing." << std::endl;
            return false;
        }
    }

    return true;
}

}
